4.0 SYSTEM MONITOR The INTELLEC MDS-225 System Monitor enables the operator to easily manipulate the contents of memory, read and produce paper tapes, and execute programs. The System Monitor uses the top 0F800-0FFFFH bytes of memory. The top half of the 2732 EPROM is mapped to this address in the memory. It is always available and can be accessed by other processors in the MDS-225. The other half of the EPROM is mapped to 0-7FFH and, simultaneously, 0E800-0EFFFH. This contains the BOOT and Diagnostics for the MDS-225. This ROM can be switched out of the memory map to make room for larger applications programs. FFFF MONITOR F800 DATA AREA 0000 a) Initial power-on or reset. Figure 4-1: Normal Use and Execution Sequence for System Software The System Monitor is the operator's interface to INTELLEC MDS-225, and controls loading and execution of application and user programs, and to some extent the debugging of user programs. Figure 4-1 illustrates memory utilization of system software use. While the System Monitor is running, it uses an area at the top of memory for data storage and scratch work. The user can determine how large this area is via the I/O subroutine MEMCK, which returns the highest momory address available for the user. 4.1 SYSTEM MONITOR IMPLEMENTATION AND EXECUTION 4.1.1 SYSTEM MONITOR IMPLEMENTATION The INTELLEC MDS-225 System Monitor program is implemented on one 2732 EPROM, which are pre-installed into each INTELLEC MDS-225. This allows System Monitor to be used with great ease, as it is not necessary to wait for lengthy operating system or papertape loading operations. All that is required to go on-line with System Monitor is to start the INTELLEC MDS-225, turn the Teletype or serial terminal on, hit a space bar to select the console, and begin execution. 4.1.2 STARTING SYSTEM MONITOR To begin operating System Monitor, either power the MDS-225 on or press the RESET button and the INTELLEC MDS-225 will automatically start the System Monitor. 4.2 SYSTEM MONITOR OPERATION AND COMMANDS A monitor command consists of a single letter typed into the Teletype keyboard or terminal followed by a number of arguments, possibly none. The arguments are separated, if there are more than one, by spaces or commas. A command is terminated and executed by typing a carriage return or space, depending upon the command. 4.2.1 A COMMAND (ASSIGN I/O DEVICES) The format of the A command is: .A ldev = pdev ldev is one of the four logical I/O devices CONSOLE, READER, PUNCH or LIST. Only the first character is required, the rest being optional. pdev is one of the four legal physical I/O devices corresponding to ldev, as shown in Table 4-1. Description: The physical device pdev is assigned to logical device ldev . The following table gives all possible A commands, with optional characters shown in lower case. Numeric values for pdev indicate user-supplied devices. .AConsole = Tty .AConsole = Crt .AConsole = Batch .AConsole = 1 .AReader = Tty .AReader = Ptr .AReader = 1 .AReader = 2 .APunch = Tty .APunch = Ptp .APunch = 1 .APunch = 2 .AList = Tty .AList = Crt .AList = Lpt .AList = 1 Table 4-1: I/O Assignment Commands For a description of the I/O system, see Section 3.3. Error Conditions: If a selected physical device has not been readred or does not exist, the monitor's execution will be undefined, usually executing an infinite loop. This may be corrected by readying the device or pressing system reset. 4.2.4 D COMMAND ( DISPLAY DATA) The format of the D command is: .D low address , high address Low address is a valid 16 bit memory address. High address is a valid 16 bit memory address equal to or greater than low address. Description: Upon execution of this command, memory data from (low address) to (high address) is displayed upon the list device ( normally the Teletype). Data are displayed in hexadecimal form. Up to sixteen bytes per line are printed, preceded by the hexadecimal address of the first byte of that line. A carriage return is forced after a byte having a low order digit of F in its memory address is printed. Example: Enter at the teletype the command: .D10F,123(Cr) and the teletype will type back: 0l0F M 0110 BB CC DD EE FF 11 22 3344 55 66 77 88 99 AB CD 0120 EF 12 34 56 where memory locations 010F through 0123 are assumed to contain BB CC DD EE FF 11 22 33 44 55 66 77 88 99 AB CD EF 12 34 56 The D command should be used only to examine memory contents. To punch the memory contents onto a paper tape, either the B command or the W command should be used. These commands produce a punched paper tape in the proper formats, while the D command causes only a simple sequence of characters to be output. Error conditions: 1. If low address or high address is greater than 16 bits I only the last 4 hex digits of the argument will be u sed as the address. Example: The command .D30010,AB0013(Cr) is equivalent to the command .D0010,0013(Cr) 2. If low address is greater than high address, only the one byte at low address will be displayed. Example: The command: .Dl0,6 is equivalent to the command .DI0,10 3. Non-existent memory is equivalent to a string of bytes all containing FF H. Example: If memory address 2000 H- 2010 H are invalid, then the command: .D2000,2010 will cause the teletype to print: 2000 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 2010 FF 4. If low address or high address contains an invalid character, or if high address is omitted, the monitor will immediately type '#(Cr)(Lf).' and await the next command. Example: If the user attempts to enter the number 0G as an address, the following will be printed: .DOG# . 4.2.5 F COMMAND ( FILL MEMORY WITH CONSTANT) The fonnat of the F command is: .F low address, high address , data Low address is a valid 16 bit memory address. High address 1s a valid 16 bit memory address equal to or greater than low address. Data is an 8 bit data value. Description: Execution of this command causes memory locations ( low address) through ( high address) to be filled with the constant ( data). Example: The command: .F7,14,AA(Cr) will set bytes 0007 through 0014 equal to AA H. 0007 AA AA AA AA AA AA AA AA AA 0010 AA AA AA AA AA Error Conditions: 1. If low address or high address is greater than 16 bits ( or data 1s greater than 8 bits), only the last 4 ( or 2 ) hex digits will be used. Example: The command: .F7AB0007,0014,FFACAA(Cr) is equivalent to the command: .F0007,0014,AA(Cr) 2. If low address is greater than high address, data will replace only the byte at low address. Example: If locations 7,8, and 9 contain AA H, BB H, and CC H, execution of the command: .F7,1,33(Cr) will cause memory to appear as follows: 0007 33 BB CC 3. If a non-existent memory address is specified, this command has no effect. 4. If low address, high address, or data contain an invalid character, the monitor will immediately type '#(Cr)(lf).' and await the next command. Example: If the user tries to enter BQ as data, the following will be printed: .F0012,14,BQ# . 4.2.6 G COMMAND (GO TO) The format of the G command is: .G address, bkptl, bkpt2 Address, bkptl, and bkpt2 are valid 16 bit hexadecimal memory addresses. Description: The G command causes program control to be transferred to location address. If either bkptl or bkpt2 is specified, a breakpoint will be set in the program at the corresponding address(es). The specified address must correspond to the first byte of a program instruction. If either breakpoint is encountered during program execution, the System Monitor will save all program status (CPU registers and condition bits), clear all existing breakpoints, and take control. The user may then examine and/or modify registers or memory, or use any other monitor commands. This feature allows the user to debug portions of a program. If address is not specified, the program status is restored and the saved value of the program counter is used as the new starting address. NOTE: Encountering a breakpoint may be simulated at any time by setting the console. Address/Instruction/Data switches to CFH and pressing the INT switch. All breakpoints will be cleared, status will be saved, and the System Monitor will take control. Example: The command: .G24A will cause program execution to begin at location 24AH, with no breakpoints being set. The command: .G,12C will cause a breakpoint to be set at 12CH, and program execution to resume at the address indicated by the saved value of the program counter. The command: .G will cause program execution to resume at the address indicated by the saved value of the program counter, with all status restored and no breakpoints set. Error Conditions: 1. If address is greater than 16 bits, only the last 4 hex digits of the argument will be used as the address. Example: The command: .G3C0010(Cr) is equivalent to the command .G0010(Cr) 2. If address is a non-existent memory address, the system will attempt to transfer control and then stop with no response. The System Monitor must then be manually restarted. 4.2.X I Command (INPUT PORT COMMAND) The format of the I command is: .I port address port address is a valid 8-bit port address. Description: The I command reads a byte from the designated port address and displays it on the console. Example: .I78(Cr) 18 . Error Conditions: 1. If port address is greater than 8 bits, only the last 2 hex digits of the argument will be used as the address. Example: The command: .IAF00FF(Cr) is equivalent to the command: .IFF(Cr) 2. If non-existent port address is referenced, the value returned will be 00h. 3. If port address contains an invalid character, the monitor will immediately type '#(Cr)(If).' and await the next command. Example: If the user attempts to enter 3G as the port address, the following will be printed: .I3G# . 4.2.9 M COMMAND (MOVE MEMORY) The format of the M command is: .M low address , high address, destination address Low address is a valid 16 bit memory address. High address is a valid 16 bit memory address equal to or greater than low address. Destination address is a valid 16 bit memory address. Description: The M command causes the block of memory from low address through high address to be moved to the locations in memory beginning at destination address. Example: If memory appears as follows: LOCATIONS DATA 0300-0304 contain 01020304 0200-0204 contain A1A2A3A4 then the command: .M200,204,300 will cause the following: LOCATIONS DATA 0300-0304 contain A1A2A3A4 0200-0204 contain A1A2A3A4 Note: The movement is performed byte by byte: the byte at low address is moved to destination address, then low address+1 is moved to destination address+1, etc. Therefore, the MOVE command may be used to fill memory with a byte or sequence of bytes. Example: If location 0300 H contains FF H, the command .M300,310,301(Cr) will cause locations 300 through 310 to contain FF H. The FF at 300 is moved to 301, then the byte at 301 (which is now FF), is moved to 302, and so on. Error Conditions: 1. If any address is greater than 16 bits, only the last 4 hex digits are used as the address. Example: The command: .M00302,303,00405(Cr) is equivalent to the command: .M302,303,405(Cr) 2. If low address is greater than high address, only one byte will be moved from low address to destination address. Example: The command: .M300,2F0,100(Cr) is equivalent to the command: .M300,300,100(Cr) 3. If low address through high address specifies a non-existent range of memory, bytes of FF H will be moved to the memory locations specified by destination address. Example: If locations 2000 H through 2005 are non-existent, the command: .M2000,2005,100(Cr) will cause locations 0100 H through 0105 H to contain FF H. 4. If an invalid character is entered in an address, the monitor will type '#(Cr)(If).' and await the next command. Example: If the user attempts to enter 0BAG as the destination address, the following will be printed: .M100,10F,0BAG# . 4.2.X O Command (OUTPUT PORT COMMAND) The format of the O command is: .O port address , byte port address is a valid 8-bit port address. byte is a valid 8-bit byte. Description: The O command writes a byte to the designated port address. Example: .O20,20(Cr) . This will write 20H to port 20H. Error Conditions: 1. If port address or byte is greater than 8 bits, only the last 2 hex digits of the argument will be used.. Example: The command: .OAF00FF,20(Cr) is equivalent to the command: .OFF,20(Cr) 2. If non-existent port address is referenced the command will be executed to the non-existant port address. 3. If port address or byte contains an invalid character, the monitor will immediately type '#(Cr)(If).' and await the next command. Example: If the user attempts to enter 3G as the port address, the following will be printed: .O20,3G# . 4.2.X Q COMMAND (QUERY IOBYTE) The format of the Q command is: .Q Description: The Query command reads the contents of the I/O BYTE and displays the mapping to the console. Example: .Q(Cr) Produces C=T R=T P=T L-T 4.2.10 R COMMAND (READ HEX FILE) The format of the R command is: .R bias address Bias Address is a 16 bit two's complement hexadecimal number. Description: This command loads paper tape punched in hexadecimal format (using the W command) into memory. The address at which the tape is loaded is detemined by adding the address punched on the tape to the bias address using two's complement arithmetic. The bias may be negative, but in this case must be in two's complement form. If the tape was produced using an E command with a non-zero entry point address (see section 4.2.13), control will be transferred to that location in memory. Otherwise, the System Monitor will remain in control and request another command. Example: If a tape was punched which began at location 0100 H, the following command: .RFFB0(Cr) will cause the tape to be read and loaded into location 50 H. (l00+FFB0= 50). NOTE: If an error occurs while reading the tape (such as a checksum error), the monitor will immediately stop reading the tape, type'#(Cr)(Lf).' and await the next command. The operation may be retried by backing up the tape to any point before the last colon and issuing another R command, since each data word specifies the address at which it is to be loaded. The monitor will read up to the first colon it encounters, and then begin loading data. Note that this means that, if you wish to change data in locations in memory, it is not necessary to regenerate an entirely new tape with the change; instead you may read in the original tape, then read in a patch tape which reloads only the erroneous locations. Error Conditions: 1. If the bias address is greater than 16 bits, only the last 4 hex digits are used a s the bia s address. Example: The command: .R00FFB0(Cr) is equivalent to the command: .RFFB0(Cr) 2. If an invalid character is present in the bias address, the monitor will immediately type '#(Cr)(Lf).' and await the next command. Example: If the user attempts to enter G00 as a bias address, the following will be printed: .RG# . 4.2.11 S COMMAND ( SUBSTITUTE MEMORY) The S command is used to display and/or modify the contents of individual memory locations. It is used as follows: 1. Type an S, followed by the hexadecimal address of the first memory location you wish to display. Type space. 2. The data from the selected address is displayed, followed by a dash (-). 3. To modify memory, type in the new data followed by a space or a carriage return. If you do not wish to modify the contents of that location, do not type any data in, but only type a space or carriage return. 4. If a space was typed in step 3, the next memory location will be displayed as in step 2. If a carriage return was typed, operation will be returned to the System Monitor. Example: The contents of the first four bytes of memory is 00 Al CE FF. You wish to change it to 00 A3 CE 11. .S0000(SP)00(Sp)A1 - A3(Sp) CE - FF - 11(Cr) Error Conditions: 1. If address is greater than 16 bits, or the data to be substituted is greater than 8 bits, only the last 4 or 2 hex digits respectively are used. Example: The following sequence is equivalent to the previous example: .S0000(Sp)00(Sp) A1 - BA3(Sp) CE - (Sp) FF - 011(Cr) 2. If an invalid character is encountered, the monitor will immediately type '#(Cr)(Lf).' and await the next command. 4.2.12 X COMMAND (EXAMINE AND MODIFY REGISTERS) The format of the X command is: .X reg ident Reg ident is a single character specifying a CPU register as follows: A = A register B = B regi ster C = C register D = D register E = Eregister F = Flag byte, displayed in the form as it is stored by the instruction PUSH PSW H = H register L = L register M = Hand L registers combined (16 bits) P = Program counter (16 bits) S = Stack pointer (16 bits) Note: The format of the flag byte F is: A S Z 0 C 0 P 1 C Sign Bit Carry Bit Zero Bit Always 1 Always 0 Parity Bit Auxillary Carry Bit Always 0 Description: The X command is used to display and/or modify CPU registers. It operates similar to the S command, as follows: 1. Type an X, followed by the register identifier. 2. The data from the selected register is displayed, followed by a dash (-). Four hexadecimal digits are displayed for M, P, and S; tw0 hex digits for the other register identifiers. 3. To modify the register, type in the new data fOllowed by a space or a carriage return. If you do pot wish to modify the register, type only the space or carriage return. 4. If a space was typed in step 3, the next register in alphabetical order is displayed. If carriage return was typed, the X command is terminated. If a space is typed after register S has been displayed, the command is terminated, this being the last register identifier in the list. Example: The A, B, C, and D registers contain AAH, BBH, CCH, and DDH, respectively. You wish to change the B and C registers to 00H and FFH, respectively. .XA(Sp) AA - (Sp) BB - 00(Sp) CC - FF(Sp) DD-(CR) Note: Values set by the X-command will become the actual contents of the registers after execution of the next GO command. The values displayed by the X-command are the contents of the registers prior to the execution of the last breakpoint set by the GO command. These displayed values, however, will reflect any changes of register "contents" made by the execution of X-commands since this last breakpoint. Type an X followed by a carriage return. The contents of all internal registers will be printed out in the same form as above. Error Conditions: 1. If the data to be substituted is greater than 16 bits for registers M, P, S, or 8 bits for the other register identifiers, only the last 4 or 2 hex digits respectively are used. 2. If an invalid register identifier or character is encountered, the monitor will immediately type '#(Cr)(Lf).' and await the next command. 4.2.14 W COMMAND (WRITE MEMORY) The format of the W command is: .W low address,. high address Low address is a valid 16 bit memory address. High address is a valid 16 bit memory address equal to or greatAr than low address. Description: The W command is used to output memory locations low address through high address to the system punch device in hexadecimal format. A series of W commands may be issued in order to punch various non-contiguous memory locations onto a continuous strip of tape. Any series of W commands should be terminated with an E command in order to punch a termination character, so that when the tape is read it will be handled properly. Example: If memory locations I through 3 contain 53F8EC, the command: .W0001,0003(Cr) produces: :0300010053F8ECC5 (See Appendix D for an explanation of paper tape format.) Error Conditions: 1. If low address or high address is greater than 16 bits, only the last 4 hex digits of the argument will be used as the address. Example: The command: .WAB0010,100(Cr) is equivalent to the command: .W0010,100(Cr) 2. If low address is greater than high address, only the one byte at low address will be punched. Example: The command: .W10,0(Cr) is equivalent to the command: .W10,10(Cr) 3. Non-existent memory is equivalent to a string of bytes all containing FF H. 4. An invalid character in either address will cause the monitor to print '#(Cr)(Lf).' and await the next command. Example: If the user attempts to enter 3Z as low address, the following will be printed: .W3Z# .